﻿using GCTrackableRace.Interfaces;

namespace GcTrackableRace.Entities
{
	public class Geocache: IGeocache
	{
		public string Code { get; set; }
		public string Name { get; set; }
		public string Type { get; set; }
		public string Country { get; set; }
		public string State { get; set; }
		public string County { get; set; }
		public double Elevation { get; set; }
		public double Longitude { get; set; }
		public double Latitude { get; set; }
		public string Container { get; set; }
		public decimal Difficulty { get; set; }
		public decimal Terrain { get; set; }

		public bool IsTraditionalCache
		{
			get { return Type == GeocacheType.TraditionalCache; }
		}

		public bool IsEarthCache
		{
			get { return Type == GeocacheType.EarthCache; }
		}

		public bool IsUnknownCache
		{
			get { return Type == GeocacheType.UnknownCache; }
		}

		public bool IsMultiCache
		{
			get { return Type == GeocacheType.MultiCache; }
		}

		public bool IsCitoCache
		{
			get { return Type == GeocacheType.CitoCache; ; }
		}

		public bool IsMegaCache
		{
			get { return Type == GeocacheType.MegaCache; }
		}

		public bool IsEventCache
		{
			get { return Type == GeocacheType.EventCache; }
		}

		public bool IsBasicTbHotelCache
		{
			get
			{
				if (
						(
							Name.Contains("Hotel")
							||
							Name.Contains("Inn")
							||
							Name.Contains("Lodge")
						)
						&&
						(
							Container == ContainerType.Regular
							||
							Container == ContainerType.Large
						)
					)
					return true;

				return false;
			}
		}

		public bool IsEither2Point5DifTerOrAboveCache
		{
			get
			{
				if (Difficulty >= 2.5M || Terrain >= 2.5M)
					return true;

				return false;
			}
		}
	}
}